package cn.kshost.zqyg.product.controller;

import cn.kshost.zqyg.model.entity.product.Brand;
import cn.kshost.zqyg.model.vo.common.Result;
import cn.kshost.zqyg.model.vo.common.ResultCodeEnum;
import cn.kshost.zqyg.product.service.BrandService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/api/product/brand")
public class BrandController {

    @Autowired
    private BrandService brandService;

    @GetMapping("/findAll")
    public Result<List<Brand>>findAll(){
        List<Brand> brandList =  brandService.selectAll();
        return Result.build(brandList, ResultCodeEnum.SUCCESS);
    }


}
